package com.jkt.rms.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.jkt.rms.commons.utils.RMSException;

public class LoginSuccessController extends SimpleFormController {

	// public Object formBackingObject(HttpServletRequest request) throws
	// ServletException
	// {
	// LoginFormBean backingObject = new LoginFormBean();
	// return backingObject;
	// }

	/*
	 * public ModelAndView handleRequest(HttpServletRequest
	 * request,HttpServletResponse response) throws Exception {
	 * System.out.println("inside handleRequest"); if(null
	 * !=request.getSession(false)) { return new ModelAndView("loginsuccess"); }
	 * HttpSession jbSession = request.getSession(true);
	 * System.out.println("New Session Created : "+ jbSession); return new
	 * ModelAndView("loginform"); }
	 */

	/*
	 * public void doSubmitAction(Object command) {
	 * 
	 * LoginFormBean lBean = (LoginFormBean)command;
	 * System.out.println("username :"+lBean.getUsrid());
	 * System.out.println("password :"+lBean.getUsrpwd());
	 * 
	 * }
	 */

	/*
	 * The below method can be used if we need to move to another page rather
	 * than the one defined in the successView property page.
	 */

	public ModelAndView onSubmit(HttpServletRequest request,
			HttpServletResponse response, Object command, BindException errors)
			throws RMSException {
		// Create session now.

		return new ModelAndView("loginsuccess");
	}

}
